package com.jason.bbs.hystrix;

import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet;

@Configuration
public class HystrixConfig {
	@Bean
	public ServletRegistrationBean<HystrixMetricsStreamServlet> hystrixMetricsStreamServlet() {
		HystrixMetricsStreamServlet hms = new HystrixMetricsStreamServlet();
		ServletRegistrationBean<HystrixMetricsStreamServlet> srb = new ServletRegistrationBean<HystrixMetricsStreamServlet>(
				hms, "/hystrix.stream");
		srb.setName("hystrixStream");
		return srb;
	}
}
